import request from "../uitls/http"
//分页查询 通过当前页数和每页帖子数量查询
export const getListDate=(obj)=>request({
  url:"/invitation/getListData",
  method:"post",
  data:{
    pageNum:obj.pageNum,
    pageSize:obj.pageSize
  }
})
//添加帖子 obj里面封装帖子的基本信息 后端要多存入一个创建时间
export const addInvite=(obj)=>request({
  url:"/invitation/addInvite",
  method:"post",
  data:{
    inviteContent:obj.inviteContent,
    inviteTitle:obj.inviteTitle,
    type:obj.type,
    userCode:obj.userCode
  }
})
//通过标题获取帖子信息
export const getListDateByTitle=(obj)=>request({
  url:"/invitation/getListDataByTitle",
  method:"post",
  data:{
    inviteTitle:obj.inviteTitle
  }
})
//最新帖子获取
export const getNewListData=()=>request({
  url:"/invitation/getNewListData",
  method:"post",
})
//最热帖子获取
export const getReListData=()=>request({
  url:"/invitation/getReListData",
  method:"post",
})
//通过类型获取帖子（一次获取最新发布的前15个）
export const getListDataByType=(obj)=>request({
  url:"/invitation/getListDataByType",
  method:"post",
  data:{
    type:obj.type,
    pageSize:obj.pageSize
  }
})
//展示帖子具体的东西
export const getListDataByInviteCode=(obj)=>request({
  url:"/invitation/getListDataByInviteCode",
  method:"post",
  data:{
    inviteCode:obj.inviteCode
  }
})
//通过帖子编号获取评论信息
export const getPingLunByInviteCode=(obj)=>request({
  url:"/invitation/getPingLunByInviteCode",
  method:"post",
  data:{
    inviteCode:obj.inviteCode
  }
})
//帖子访问人数统计+1
export const addCensus=(obj)=>request({
  url:"/invitation/addCensus",
  method:"post",
  data:{
    inviteCode:obj.inviteCode,
    userCode:obj.userCode
  }
})
//收藏帖子
export const collection=(obj)=>request({
  url:"/invitation/collection",
  method:"post",
  data:{
    inviteCode:obj.inviteCode,
    userCode:obj.userCode
  }
})
//写下评论(在帖子上面写评论)回帖 不加评论编号
export const writePinglun=(obj)=>request({
  url:"/invitation/writePinglun",
  method:"post",
  data:{
    inviteCode:obj.inviteCode,
    userCode:obj.userCode,
    commentText:obj.commentText,
  }
})
//写下评论(在评论上面写评论)回复 加评论编号
export const writeReply=(obj)=>request({
  url:"/invitation/writeReply",
  method:"post",
  data:{
    inviteCode:obj.inviteCode,
    userCode:obj.userCode,
    commentText:obj.commentText,
    commentCode:obj.commentCode
  }
})
//通过用户编号获取收藏的帖子
export const getSCListDateByUserCode=(obj)=>request({
  url:"/invitation/getSCListDateByUserCode",
  method:"post",
  data:{
    userCode:obj.userCode
  }
})
//通过帖子编号删除用户收藏的帖子
export const deleteShoucang=(obj)=>request({
  url:"/invitation/deleteShoucang",
  method:"post",
  data:{
    inviteCode:obj.inviteCode,
    userCode:obj.userCode
  }
})
//通过用户编号获取用户的帖子
export const getListDateByUserCode=(obj)=>request({
  url:"/invitation/getListDateByUserCode",
  method:"post",
  data:{
    userCode:obj.userCode
  }
})
//通过帖子编号和用户编号除用户发的帖子
export const deleteInvite=(obj)=>request({
  url:"/invitation/deleteInvite",
  method:"post",
  data:{
    inviteCode:obj.inviteCode,
    userCode:obj.userCode
  }
})
//通过帖子编号修改帖子内容
export const updateInvite=(obj)=>request({
  url:"/invitation/updateInvite",
  method:"post",
  data:{
    inviteContent:obj.inviteContent,
    inviteTitle:obj.inviteTitle,
    type:obj.type,
    inviteCode:obj.inviteCode
  }
})
  